package com.hudson.common.domain.request;


import com.hudson.common.domain.Duration;

import java.util.Objects;

/**
 * @Author: 渔小鲤
 * @DateTime: 2025/7/27 23:16
 **/
public class SendRelayMessageReq<T> {

    private  String type;
    private  String messageId;
    private  String topic;

    private  int queueId;
    private  T jsonObj;

    private Duration duration;

    public SendRelayMessageReq(String type, String messageId, String topic, int queueId, T jsonObj, Duration duration) {
        this.type = type;
        this.messageId = messageId;
        this.topic = topic;
        this.queueId = queueId;
        this.jsonObj = jsonObj;
        this.duration = duration;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getMessageId() {
        return messageId;
    }

    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public int getQueueId() {
        return queueId;
    }

    public void setQueueId(int queueId) {
        this.queueId = queueId;
    }

    public T getJsonObj() {
        return jsonObj;
    }

    public void setJsonObj(T jsonObj) {
        this.jsonObj = jsonObj;
    }

    public Duration getDuration() {
        return duration;
    }

    public void setDuration(Duration duration) {
        this.duration = duration;
    }

    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;
        SendRelayMessageReq<?> that = (SendRelayMessageReq<?>) o;
        return queueId == that.queueId && Objects.equals(type, that.type) && Objects.equals(messageId, that.messageId) && Objects.equals(topic, that.topic) && Objects.equals(jsonObj, that.jsonObj) && Objects.equals(duration, that.duration);
    }

    @Override
    public int hashCode() {
        return Objects.hash(type, messageId, topic, queueId, jsonObj, duration);
    }
}
